using Microsoft.Xna.Framework;

namespace Brouteforce.UserInterface.Abstracts
{
    public abstract class AbstractUIControl
    {
        public string Name;
        protected bool Focused;
        protected Rectangle RelativeUIcontrolRectangle;
        protected Rectangle CurrentUIcontrolRectangle;

        protected AbstractUIControl(string UIcontrolName, Rectangle relativeSurroundingRectangle)
        {
            Name = UIcontrolName;
            RelativeUIcontrolRectangle = relativeSurroundingRectangle;
            CurrentUIcontrolRectangle = relativeSurroundingRectangle;
        }

        public bool IsFocused()
        {
            return Focused;
        }

        public void RemoveFocus()
        {
            Focused = false;
        }

        public void AddFocus()
        {
            Focused = true;
        }

        public void setOffset(Vector2 offset)
        {
            CurrentUIcontrolRectangle.X = RelativeUIcontrolRectangle.X + (int)offset.X;

            CurrentUIcontrolRectangle.Y = RelativeUIcontrolRectangle.Y + (int)offset.Y;
        }
        public abstract void Update();

        public abstract void Draw(GameTime gameTime);
    }
}
